//
//  ZYFirstTableViewCell.m
//  MusicMV
//
//  Created by dllo on 16/3/25.
//  Copyright © 2016年 Eternity. All rights reserved.
//

#import "ZYFirstTableViewCell.h"

@implementation ZYFirstTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.imagView = [[UIImageView alloc] init];
        _imagView.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:_imagView];
        [_imagView mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.left.mas_equalTo(5);
            make.top.mas_equalTo(5);
            make.bottom.mas_equalTo(-5);
            make.right.mas_equalTo(-300);
        }];
        
        self.label = [[UILabel alloc] init];
        _label.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_label];
        [_label mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.left.mas_equalTo(_imagView.mas_right).offset(5);
            make.top.mas_equalTo(_imagView);
            make.right.mas_equalTo(-200);
            make.bottom.mas_equalTo(-50);
            
        }];
        
        self.downLabel = [[UILabel alloc] init];
        _downLabel.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_downLabel];
        
        [_downLabel mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.left.mas_equalTo(_imagView.mas_right).offset(5);
            make.top.mas_equalTo(_label.mas_bottom).offset(5);
            make.bottom.mas_equalTo(-5);
            make.right.mas_equalTo(-5);
            
        }];
    }
    
    return self;
}


- (void)setModel:(ZYPLModel *)model {
    _model = model;
    [_imagView sd_setImageWithURL:[NSURL URLWithString:_model.avatar]];
    _label.text = _model.name;
    _downLabel.text = _model.content;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
